package com.ruoyi.hikvision.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hikvision.mapper.HikvisionDeviceMapper;
import com.ruoyi.hikvision.domain.HikvisionDevice;
import com.ruoyi.hikvision.service.IHikvisionDeviceService;

/**
 * 设备管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-02
 */
@Service
public class HikvisionDeviceServiceImpl implements IHikvisionDeviceService 
{
    @Autowired
    private HikvisionDeviceMapper hikvisionDeviceMapper;

    /**
     * 查询设备管理
     * 
     * @param id 设备管理主键
     * @return 设备管理
     */
    @Override
    public HikvisionDevice selectHikvisionDeviceById(Long id)
    {
        return hikvisionDeviceMapper.selectHikvisionDeviceById(id);
    }

    @Override
    public HikvisionDevice selectHikvisionDeviceByDeviceNo(String deviceNo)
    {
        return hikvisionDeviceMapper.selectHikvisionDeviceByDeviceNo(deviceNo);
    }

    @Override
    public List<HikvisionDevice>  selectHikvisionDeviceByIds(Long[] id)
    {
        return hikvisionDeviceMapper.selectHikvisionDeviceByIds(id);
    }

    /**
     * 查询设备管理列表
     * 
     * @param hikvisionDevice 设备管理
     * @return 设备管理
     */
    @Override
    public List<HikvisionDevice> selectHikvisionDeviceList(HikvisionDevice hikvisionDevice)
    {
        return hikvisionDeviceMapper.selectHikvisionDeviceList(hikvisionDevice);
    }

    /**
     * 新增设备管理
     * 
     * @param hikvisionDevice 设备管理
     * @return 结果
     */
    @Override
    public int insertHikvisionDevice(HikvisionDevice hikvisionDevice)
    {
        hikvisionDevice.setCreateTime(DateUtils.getNowDate());
        return hikvisionDeviceMapper.insertHikvisionDevice(hikvisionDevice);
    }

    /**
     * 修改设备管理
     * 
     * @param hikvisionDevice 设备管理
     * @return 结果
     */
    @Override
    public int updateHikvisionDevice(HikvisionDevice hikvisionDevice)
    {
        hikvisionDevice.setUpdateTime(DateUtils.getNowDate());
        return hikvisionDeviceMapper.updateHikvisionDevice(hikvisionDevice);
    }

    /**
     * 批量删除设备管理
     * 
     * @param ids 需要删除的设备管理主键
     * @return 结果
     */
    @Override
    public int deleteHikvisionDeviceByIds(Long[] ids)
    {
        return hikvisionDeviceMapper.deleteHikvisionDeviceByIds(ids);
    }

    /**
     * 删除设备管理信息
     * 
     * @param id 设备管理主键
     * @return 结果
     */
    @Override
    public int deleteHikvisionDeviceById(Long id)
    {
        return hikvisionDeviceMapper.deleteHikvisionDeviceById(id);
    }
}
